/**************************************************
ratification pivots for Laeken. 
EB data from Thomas- assumes electoral systems are proportional
November 17, 2005
**************************************************/

clear 
version 8 

use "C:\Documents and Settings\Jonathan Slapin\My Documents\Data\tkoenig\laeken pivots\pivots_prop"

cd "C:\Documents and Settings\Jonathan Slapin\My Documents\Laeken"

* drop questions not used in our analysis

drop  q3a_1 q3a_2 q3a_3 q3a_4 q3a_5 q3a_6 q3a_7 q3a_8 q3a_9 q3a_10 q3a_11 q3a_12 /*
*/ q3a_13 q3a_14 q3a_15 q3a_16 q3a_17 q3a_18 q3a_19 q3a_20 q3a_21 q3a_22 q3a_23 /*
*/ q3a_24 q3a_25 q14a q23

* add questions we do use
gen qq19_2=q19a
gen qq2_1=q2a
gen qq2_2=q2a
gen qq2_3=q2a
gen qq2_4=q2a
gen qq2_5=q2a
gen qq9_2=q9a

reshape long q, i(memstate) j(question) string
rename q pivotpos

replace question="q1" if question=="1a"
replace question="q2" if question=="2a"
replace question="q3" if question=="3a"
replace question="q4" if question=="4a"
replace question="q5" if question=="5a"
replace question="q6" if question=="6a"
replace question="q7" if question=="7a"
replace question="q8" if question=="8a"
replace question="q9" if question=="9a"
replace question="q10" if question=="10a"
replace question="q11" if question=="11a"
replace question="q12" if question=="12a"
replace question="q13" if question=="13a"
replace question="q14" if question=="14a"
replace question="q15" if question=="15a"
replace question="q16" if question=="16a"
replace question="q17" if question=="17a"
replace question="q18" if question=="18a"
replace question="q19" if question=="19a"
replace question="q20" if question=="20a"
replace question="q21" if question=="21a"
replace question="q22" if question=="22a"
replace question="q23" if question=="23a"

gen country=1 if memstate=="AUS"
replace country=2 if memstate=="BUL"
replace country=3 if memstate=="BEL"
replace country=4 if memstate=="CYP"
replace country=5 if memstate=="CZR"
replace country=6 if memstate=="DEN"
replace country=7 if memstate=="EST"
replace country=8 if memstate=="FIN"
replace country=9 if memstate=="Frau"
replace country=10 if memstate=="GER"
replace country=11 if memstate=="GRE"
replace country=12 if memstate=="HUN"
replace country=13 if memstate=="IRE"
replace country=14 if memstate=="ITA"
replace country=15 if memstate=="LAT"
replace country=16 if memstate=="LIT"
replace country=17 if memstate=="LUX"
replace country=18 if memstate=="NL"
replace country=19 if memstate=="POL"
replace country=20 if memstate=="POR"
replace country=21 if memstate=="ROM"
replace country=22 if memstate=="SLO"
replace country=23 if memstate=="SLN"
replace country=24 if memstate=="SPA"
replace country=25 if memstate=="SWE"
replace country=26 if memstate=="TURK"
replace country=27 if memstate=="UK"
replace country=28 if memstate=="MAL"

drop memstate

save temppivots, replace
